|
STEP 10: Embedding Groovoids
|
Groovoids are "pre-cooked" musical cues that come bundled with the player. Groovoids provide an easy way to sonify a Web page because they are built right into the player's soundbank and don't require any extra downloading for the person visiting your sonified Web page. For a more thorough explanation of Groovoids, consult the section Important Concepts: Groovoids.
Now, while some categories of Groovoids are only really appropriate for the more sophisticated sonification of user interface elements (buttons, links, form fields, etc.), the Groovoids from the Background, Fanfare, and Hits categories can be embedded very easily in a page, to play when the page loads in. This page, for example, has the Groovoid "Background-Smooth" playing as the soothing background music (see the player control panel below).
Groovoids can be easily embedded in a page by simply adding the GROOVOID embedding property to the EMBED tag. The source code listing below shows the HTML code that was used to embed the Groovoid "Background-Smooth" in this page...
<EMBED
SRC="stub.rmf"
GROOVOID="Background-Smooth"
TYPE="audio/rmf"
WIDTH=144
HEIGHT=60
DISPLAY=SONG
AUTOSTART=TRUE
LOOP=TRUE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
|
From the source code listing, you will notice that the additional GROOVOID property has been highlighted. You should also notice that the EMBED tag still contains a SRC property. While the GROOVOID property always overrides any file specified by the SRC property, it is still recommended to specify a valid file URL in the SRC property to maintain backward compatibility with some older browser versions that required a plug-in to be embedded with a valid file URL specified for the SRC property. In browsers that don't have this problem, the player simply ignores the SRC property when the GROOVOID property is present, so no extra downloading is required in the majority of cases.
In this example, we've chosen to display the control panel for the player. However, we could just as easily make the player instance be invisible so that all you had was the Groovoid playing as the background music for the page without there being any indication that a plug-in is being used in the page. You may remember seeing this approach in the earlier step of this tutorial, Music You Cannot See.
Now, if we wanted to play the same Groovoid "Background-Smooth" but make the player invisible on the page, then the code would look as follows...
<EMBED
SRC="stub.rmf"
GROOVOID="Background-Smooth"
TYPE="audio/rmf"
WIDTH=0
HEIGHT=0
HIDDEN
AUTOSTART=TRUE
LOOP=TRUE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
|
In the source code listing above, the highlighted text represents the code needed to make the player be invisible on the page. You will also notice that we have removed the DISPLAY=SONG embedding property from the EMBED tag. When a player instance is hidden, it is not necessary to specify a value for the DISPLAY embedding property because there is nothing to display.
For a full list of all the available Groovoids, consult the appendix Beatnik Soundbank - Groovoids. For a more in-depth discussion of how the Groovoids are divided up into different categories, consult the section Important Concepts: Groovoids.